Expire pages with variable replacements after 1 hour, to prevent obsolete dates and...
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 5 Sep 2003 21:12:24 +0000 (21:12 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 5 Sep 2003 21:12:24 +0000 (21:12 +0000)
includes/Article.php

index a7ed414..5df7f16 100644 (file)
@@ -1063,8 +1063,14 @@ class Article {
        
        function tryFileCache() {
                if($this->isFileCacheable()) {
+                       $touched = $this->mTouched;
+                       if( strpos( $this->mContent, "{{" ) !== false ) {
+                               # Expire pages with variable replacements in an hour
+                               $expire = wfUnix2Timestamp( time() - 3600 );
+                               $touched = max( $expire, $touched );
+                       }
                        $cache = new CacheManager( $this->mTitle );
-                       if($cache->isFileCacheGood( $this->mTouched )) {
+                       if($cache->isFileCacheGood( $touched )) {
                                wfDebug( " tryFileCache() - about to load\n" );
                                $cache->loadFromFileCache();
                                exit;